package cn.org.alan.exam.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;

/**
 * 说明：
 * 作业表
 *
 * @Author Alan
 * @Version 1.0
 * @Date 2025/4/3 9:24 PM
 */
@Data
@ApiModel("作业表")
@TableName("t_job")
public class Job {

    @ApiModelProperty("作业表主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "标题不能为空")
    @ApiModelProperty("标题")
    private String title;

    @NotBlank(message = "内容不能为空")
    @ApiModelProperty("内容")
    private String content;

    @ApiModelProperty("创建人ID")
    private Integer userId;

    @NotNull(message = "班级ID不能为null")
    @ApiModelProperty("班级ID")
    private Integer gradeId;

    @TableLogic
    @ApiModelProperty("逻辑删除字段")
    private Integer isDeleted;

    @ApiModelProperty("开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty("截止时间")
    private LocalDateTime endTime;

    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
}
